package com.ssy.lingxi.purchase.api.enums.bidding;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 采购询价单- 审核竞价结果内部流转状态图枚举
 * @author lxc
 * @date 2022/4/6
 */
public enum BiddingInteriorWorkStepEnum {

    SUBMIT_BIDDING_RETUEN(5, "提交审核竞价结果"),
    STAY_AUDIT_BIDDING1_RETUEN(6, "审核竞价结果(一级)"),
    STAY_SUBMIT_BIDDING2_RETUEN(7, "审核竞价结果(二级)"),
    CONFIRMATION_BIDDING_RETUEN(8, "确认竞价结果"),
    ;

    private Integer state;
    private String name;

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.state);
    }

    public void setName(String name) {
        this.name = name;
    }

    BiddingInteriorWorkStepEnum(Integer state, String name) {
        this.state = state;
        this.name = name;
    }

    public static String getName(Integer state){
        BiddingInteriorWorkStepEnum workEnum = Arrays.stream(BiddingInteriorWorkStepEnum.values()).filter(v -> v.getState().equals(state)).findAny().orElse(null);
        return null == workEnum ? "" : LanguageHolder.getName(BiddingInteriorWorkStepEnum.class, workEnum.getState());
    }
}
